package utils;

import java.util.GregorianCalendar;
import java.util.Timer;
import java.util.TimerTask;

public class Reminder {
    Timer timer;

    public Reminder(int seconds) {
        timer = new Timer();
        timer.schedule(new RemindTask(),GregorianCalendar.getInstance().getTime(), seconds*1000);
	}

    class RemindTask extends TimerTask {
        public void run() {
            System.out.format("Time's up!%n");
          //  timer.cancel(); //Terminate the timer thread
        }
    }

    public static void main(String args[]) {
        new Reminder(5);
       // System.out.format("Task scheduled.%n");
    }
}
